#!bin/bash
git reset --hard
git pull
mvn clean package -Dmaven.test.skip=true
#删除容器
if [ $(docker ps -aq --filter name=my-source) ]; then
  docker rm -f my-source
fi
#删除镜像
if [[ $(docker images |grep business/my-source) ]]; then
  docker rmi business/my-source:v1.0
fi
docker build  -t business/my-source:v1.0 .
docker run --restart=always   --name my-source -d -p 8112:8112 business/my-source:v1.0